<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>list_content</title>
<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Boost.Test">
<link rel="up" href="../rt_param_reference.html" title="Runtime parameters reference">
<link rel="prev" href="help.html" title="help">
<link rel="next" href="list_labels.html" title="list_labels">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="help.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../rt_param_reference.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="list_labels.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_test.utf_reference.rt_param_reference.list_content"></a><a class="link" href="list_content.html" title="list_content"><code class="computeroutput"><span class="identifier">list_content</span></code></a>
</h4></div></div></div>
<p>
          Lists the name of the <a class="link" href="../../section_glossary.html#ref_test_unit">test units</a> contained
          in the <a class="link" href="../../section_glossary.html#ref_test_module">test module</a> and exits (no
          test is run).
        </p>
<p>
          This command line parameter accepts an <span class="emphasis"><em>optional</em></span> string
          value indicating the format of the output. The framework supports the following
          two formats:
        </p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
              HRF (default), standing for <span class="emphasis"><em>Human Readable Format</em></span>,
            </li>
<li class="listitem">
              DOT, standing for the <a href="http://www.graphviz.org/doc/info/lang.html" target="_top">Graphviz
              graph format</a>. This format may be automatically parsed or rendered.
            </li>
</ol></div>
<h5>
<a name="boost_test.utf_reference.rt_param_reference.list_content.h0"></a>
          <span class="phrase"><a name="boost_test.utf_reference.rt_param_reference.list_content.hrf"></a></span><a class="link" href="list_content.html#boost_test.utf_reference.rt_param_reference.list_content.hrf">HRF</a>
        </h5>
<p>
          For HRF, the <a class="link" href="../../section_glossary.html#ref_test_tree">test tree</a> (test suites
          and test cases) is presented in a tree like form with each test unit name
          on a separate line with horizontal indentation in relation to the parent
          test suite. In addition, test units which are enabled by default have an
          asterisk <code class="computeroutput"><span class="special">*</span></code> next to the test
          unit name. For example, the following output:
        </p>
<pre class="programlisting"><span class="identifier">testsuite1</span><span class="special">*</span>
    <span class="identifier">testcase1</span><span class="special">*</span>
    <span class="identifier">testcase2</span>
<span class="identifier">testsuite2</span><span class="special">*</span>
    <span class="identifier">testcase3</span><span class="special">*</span>
</pre>
<p>
          represents test module consisting of two test suites: <code class="computeroutput"><span class="identifier">testsuite1</span></code>
          and <code class="computeroutput"><span class="identifier">testsuite2</span></code>, and three
          test cases: <code class="computeroutput"><span class="identifier">testcase1</span></code>,
          <code class="computeroutput"><span class="identifier">testcase2</span></code>, and <code class="computeroutput"><span class="identifier">testcase3</span></code>. The formatting reflects the
          test-tree: the first two test cases belong to the first test suite and
          last one belongs to the second. Out of three test cases only two are enabled
          by default: <code class="computeroutput"><span class="identifier">testcase1</span></code> and
          <code class="computeroutput"><span class="identifier">testcase3</span></code>. <code class="computeroutput"><span class="identifier">testcase2</span></code> is not enabled by default,
          but can be enabled by using the parameter <a class="link" href="run_test.html" title="run_test"><code class="computeroutput"><span class="identifier">run_test</span></code></a>.
        </p>
<h5>
<a name="boost_test.utf_reference.rt_param_reference.list_content.h1"></a>
          <span class="phrase"><a name="boost_test.utf_reference.rt_param_reference.list_content.dot"></a></span><a class="link" href="list_content.html#boost_test.utf_reference.rt_param_reference.list_content.dot">DOT</a>
        </h5>
<p>
          DOT output generates a graph representing the module's <a class="link" href="../../section_glossary.html#ref_test_tree">test
          tree</a> in a <a href="http://www.graphviz.org/doc/info/lang.html" target="_top">dot
          format</a>. This output includes much more information about the test
          tree including labels, timeouts, expected failures, and dependencies.
        </p>
<p>
          The legend is as follow:
        </p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
              the master test suite is represented as an ellipse
            </li>
<li class="listitem">
              a test unit (suite, case) is in a rounded rectangle
            </li>
<li class="listitem">
              test unit declaration location, <a class="link" href="../../tests_organization/tests_grouping.html" title="Grouping tests into logical units by labels">labels</a>,
              <a class="link" href="../../testing_tools/expected_failures.html" title="Expected failures specification">expected
              failures</a>, <a class="link" href="../../testing_tools/timeout.html" title="Time-out for test cases">timeouts</a>
              are appended,
            </li>
<li class="listitem">
              a green box indicates that the test unit that is enabled, otherwise
              its color is yellow,
            </li>
<li class="listitem">
              a plain black arrow goes from a test unit to each of its children,
              following the test tree (the arrow pointing to the child),
            </li>
<li class="listitem">
              a dashed red arrow indicates a runtime dependence on test units, the
              arrow pointing to the parent in the dependency graph.
            </li>
</ul></div>
<h5>
<a name="boost_test.utf_reference.rt_param_reference.list_content.h2"></a>
          <span class="phrase"><a name="boost_test.utf_reference.rt_param_reference.list_content.acceptable_values"></a></span><a class="link" href="list_content.html#boost_test.utf_reference.rt_param_reference.list_content.acceptable_values">Acceptable
          values</a>
        </h5>
<p>
          <a class="link" href="../rt_param_reference.html#enum_param_value">Enumeration</a> names:
        </p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
              <span class="bold"><strong>HRF</strong></span> (default)
            </li>
<li class="listitem">
              DOT
            </li>
</ul></div>
<h5>
<a name="boost_test.utf_reference.rt_param_reference.list_content.h3"></a>
          <span class="phrase"><a name="boost_test.utf_reference.rt_param_reference.list_content.command_line_syntax"></a></span><a class="link" href="list_content.html#boost_test.utf_reference.rt_param_reference.list_content.command_line_syntax">Command
          line syntax</a>
        </h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
              <code class="computeroutput"><span class="special">--</span><span class="identifier">list_content</span><span class="special">[=&lt;</span><span class="identifier">format</span><span class="special">&gt;]</span></code>
            </li></ul></div>
<h5>
<a name="boost_test.utf_reference.rt_param_reference.list_content.h4"></a>
          <span class="phrase"><a name="boost_test.utf_reference.rt_param_reference.list_content.environment_variable"></a></span><a class="link" href="list_content.html#boost_test.utf_reference.rt_param_reference.list_content.environment_variable">Environment
          variable</a>
        </h5>
<pre class="programlisting"><span class="identifier">BOOST_TEST_LIST_CONTENT</span>
</pre>
<h5>
<a name="boost_test.utf_reference.rt_param_reference.list_content.h5"></a>
          <span class="phrase"><a name="boost_test.utf_reference.rt_param_reference.list_content.example"></a></span><a class="link" href="list_content.html#boost_test.utf_reference.rt_param_reference.list_content.example">Example</a>
        </h5>
<p>
          The following <span class="emphasis"><em>deliberately</em></span> complicated example illustrates
          the purpose of the <code class="computeroutput"><span class="special">--</span><span class="identifier">list_content</span></code>
          directive. The SVG generated from the produced Graphviz/dot file can be
          downloaded <a href="../../../images/boost_runtime_list_content.svg" target="_top">here</a>.
        </p>
<h6>
<a name="boost_test.utf_reference.rt_param_reference.list_content.h6"></a>
          <span class="phrase"><a name="boost_test.utf_reference.rt_param_reference.list_content.example_descr"></a></span><a class="link" href="list_content.html#boost_test.utf_reference.rt_param_reference.list_content.example_descr">Example:
          <code class="computeroutput"><span class="special">--</span><span class="identifier">list_content</span></code>
          illustration</a>
        </h6>
<div class="informaltable"><table class="table">
<colgroup><col></colgroup>
<thead><tr><th>
                  <p>
                    Code
                  </p>
                </th></tr></thead>
<tbody><tr><td>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_TEST_MODULE</span> <span class="identifier">list_content</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">test</span><span class="special">/</span><span class="identifier">included</span><span class="special">/</span><span class="identifier">unit_test</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="keyword">namespace</span> <span class="identifier">utf</span><span class="special">=</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unit_test</span><span class="special">;</span>

<span class="comment">//// --------------------------------------------------------------------------</span>
<span class="comment">// Test suite 1, disabled by default, s1/test2 is explicitely enabled.</span>
<span class="identifier">BOOST_AUTO_TEST_SUITE</span><span class="special">(</span> <span class="identifier">s1</span><span class="special">,</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">disabled</span><span class="special">()</span>                         <span class="comment">// suite is not disabled because of the</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">description</span><span class="special">(</span> <span class="string">"disabled suite 1"</span><span class="special">)</span>   <span class="comment">// extra declaration at the end of the file</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">label</span><span class="special">(</span> <span class="string">"label1"</span> <span class="special">)</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">label</span><span class="special">(</span> <span class="string">"label2"</span> <span class="special">))</span>

<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test1</span><span class="special">,</span> <span class="comment">// s1/test1</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">enabled</span><span class="special">()</span> <span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">description</span><span class="special">(</span><span class="string">"enabled"</span><span class="special">))</span>
<span class="special">{</span>
    <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="keyword">true</span><span class="special">);</span>
<span class="special">}</span>

<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test2</span><span class="special">,</span> <span class="comment">// s1/test2</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">description</span><span class="special">(</span> <span class="string">"defaulted"</span><span class="special">)</span> <span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">expected_failures</span><span class="special">(</span> <span class="number">1</span> <span class="special">))</span>
<span class="special">{</span>
    <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="keyword">false</span><span class="special">);</span>
<span class="special">}</span>

<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test3</span><span class="special">,</span> <span class="comment">// s1/test3</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">description</span><span class="special">(</span> <span class="string">"defaulted"</span><span class="special">))</span>
<span class="special">{</span>
    <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="keyword">false</span><span class="special">);</span>
<span class="special">}</span>
<span class="identifier">BOOST_AUTO_TEST_SUITE_END</span><span class="special">()</span>


<span class="comment">//// --------------------------------------------------------------------------</span>
<span class="comment">// Test suite 2, disabled by default, s2/test2 is explicitely enabled.</span>
<span class="identifier">BOOST_AUTO_TEST_SUITE</span><span class="special">(</span> <span class="identifier">s2</span><span class="special">,</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">disabled</span><span class="special">()</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">label</span><span class="special">(</span> <span class="string">"label1"</span> <span class="special">)</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">expected_failures</span><span class="special">(</span> <span class="number">3</span> <span class="special">))</span>

<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test1</span><span class="special">,</span> <span class="comment">// s2/test1</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">description</span><span class="special">(</span> <span class="string">"defaulted"</span><span class="special">))</span>
<span class="special">{</span>
    <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="keyword">false</span><span class="special">);</span>
<span class="special">}</span>

<span class="identifier">boost</span><span class="special">::</span><span class="identifier">test_tools</span><span class="special">::</span><span class="identifier">assertion_result</span> <span class="identifier">do_it</span><span class="special">(</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">test_unit_id</span> <span class="special">)</span>
<span class="special">{</span>
   <span class="keyword">return</span> <span class="keyword">false</span><span class="special">;</span>
<span class="special">}</span>

<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test2</span><span class="special">,</span> <span class="comment">// s2/test2</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">enabled</span><span class="special">()</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">description</span><span class="special">(</span> <span class="string">"enabled w. precondition"</span><span class="special">)</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">precondition</span><span class="special">(</span><span class="identifier">do_it</span><span class="special">))</span>
<span class="special">{</span>
  <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="keyword">false</span><span class="special">);</span>
<span class="special">}</span>

<span class="comment">//// --------------------------------------------------------------------------</span>
<span class="comment">// Test suite s2/s23, disabled</span>
<span class="identifier">BOOST_AUTO_TEST_SUITE</span><span class="special">(</span> <span class="identifier">s23</span><span class="special">,</span> <span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">disabled</span><span class="special">())</span>

<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test1</span> <span class="special">)</span> <span class="comment">// s2/s23/test1</span>
<span class="special">{</span>
  <span class="identifier">BOOST_TEST</span><span class="special">(</span><span class="keyword">false</span><span class="special">);</span>
<span class="special">}</span>

<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test2</span><span class="special">,</span> <span class="comment">// s2/s23/test2</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">timeout</span><span class="special">(</span> <span class="number">10</span> <span class="special">))</span>
<span class="special">{</span>
  <span class="identifier">BOOST_TEST</span><span class="special">(</span> <span class="keyword">true</span> <span class="special">);</span>
<span class="special">}</span>

<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test3</span><span class="special">,</span> <span class="comment">// s2/s23/test3</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">enabled</span><span class="special">()</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">depends_on</span><span class="special">(</span> <span class="string">"s2/test2"</span> <span class="special">))</span>
<span class="special">{</span>
  <span class="identifier">BOOST_TEST</span><span class="special">(</span> <span class="keyword">true</span> <span class="special">);</span>
<span class="special">}</span>
<span class="identifier">BOOST_AUTO_TEST_SUITE_END</span><span class="special">()</span> <span class="comment">// s2/s23</span>
<span class="identifier">BOOST_AUTO_TEST_SUITE_END</span><span class="special">()</span> <span class="comment">// s2</span>



<span class="comment">//// --------------------------------------------------------------------------</span>
<span class="comment">// Test suite s1 continued</span>
<span class="identifier">BOOST_AUTO_TEST_SUITE</span><span class="special">(</span> <span class="identifier">s1</span> <span class="special">)</span>
<span class="identifier">BOOST_AUTO_TEST_SUITE</span><span class="special">(</span> <span class="identifier">s14</span><span class="special">,</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">depends_on</span><span class="special">(</span> <span class="string">"s2/s23/test3"</span> <span class="special">)</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">description</span><span class="special">(</span> <span class="string">"test suite which depends on another test suite"</span><span class="special">))</span>

<span class="identifier">BOOST_AUTO_TEST_CASE</span><span class="special">(</span> <span class="identifier">test1</span><span class="special">,</span> <span class="comment">// s1/s14/test1</span>
<span class="special">*</span> <span class="identifier">utf</span><span class="special">::</span><span class="identifier">depends_on</span><span class="special">(</span> <span class="string">"s2"</span> <span class="special">))</span>
<span class="special">{</span>
    <span class="identifier">BOOST_TEST</span><span class="special">(</span> <span class="string">"s14"</span> <span class="special">==</span> <span class="string">"test"</span> <span class="special">);</span>
<span class="special">}</span>

<span class="identifier">BOOST_AUTO_TEST_SUITE_END</span><span class="special">()</span> <span class="comment">// s1/s14</span>
<span class="identifier">BOOST_AUTO_TEST_SUITE_END</span><span class="special">()</span> <span class="comment">// s1</span>
</pre>
                </td></tr></tbody>
</table></div>
<div class="informaltable"><table class="table">
<colgroup><col></colgroup>
<thead><tr><th>
                  <p>
                    Output
                  </p>
                </th></tr></thead>
<tbody><tr><td>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="special">&gt;</span> <span class="special">./</span><span class="identifier">boost_runtime_list_content</span> <span class="special">--</span><span class="identifier">list_content</span>
<span class="identifier">s1</span><span class="special">*:</span> <span class="identifier">disabled</span> <span class="identifier">suite</span> <span class="number">1</span>
    <span class="identifier">test1</span><span class="special">*:</span> <span class="identifier">enabled</span>
    <span class="identifier">test2</span> <span class="special">:</span> <span class="identifier">defaulted</span>
    <span class="identifier">test3</span> <span class="special">:</span> <span class="identifier">defaulted</span>
    <span class="identifier">s14</span> <span class="special">:</span> <span class="identifier">test</span> <span class="identifier">suite</span> <span class="identifier">which</span> <span class="identifier">depends</span> <span class="identifier">on</span> <span class="identifier">another</span> <span class="identifier">test</span> <span class="identifier">suite</span>
        <span class="identifier">test1</span>
<span class="identifier">s2</span><span class="special">*</span>
    <span class="identifier">test1</span> <span class="special">:</span> <span class="identifier">defaulted</span>
    <span class="identifier">test2</span><span class="special">*:</span> <span class="identifier">enabled</span> <span class="identifier">w</span><span class="special">.</span> <span class="identifier">precondition</span>
    <span class="identifier">s23</span><span class="special">*</span>
        <span class="identifier">test1</span>
        <span class="identifier">test2</span>
        <span class="identifier">test3</span><span class="special">*</span>
</pre>
                </td></tr></tbody>
</table></div>
<p>
          <span class="inlinemediaobject"><img src="../../../images/boost_runtime_list_content.png" width="70%"></span>
        </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2001-2022 Boost.Test contributors<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="help.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../rt_param_reference.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="list_labels.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
